﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 采集网页邮箱电话
{
    public partial class about : Form
    {
        public about()
        {
            InitializeComponent();
        }

        private void about_Load(object sender, EventArgs e)
        {
            Task taskab = new Task(() =>
            {
                try {
            string url = "http://suluo.online/csharp/tools/htmlcaijiver.txt";
            WebClient client = new WebClient();
            client.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.41");
            string html = client.DownloadString(url);
            label2.Text= "最新版本：" +  html;
            string str = string.Join("", html.Split('.'));
            long res = long.Parse(str);
            if (res - 1000 > 0)
            {
                //linkLabel1.Text = "当前版本有更新，请更新！";
                button1.Visible= true;
                button1.ForeColor = Color.DodgerBlue;
            }
            else
            {
                //linkLabel1.Text = "当前版本无需更新。";
                //MessageBox.Show("当前没有更新");
            }

            }
            catch (Exception )
            {
                label2.Text = "连接超时，请检查网络连接！";
            }
            }//token
            );
            taskab.Start();

        }

        private void button1_Click(object sender, EventArgs e)
        {

            System.Diagnostics.Process.Start("https://suluo.online/csharp/tools/采集助手.html");
        
        }
    }
}
